﻿using DataAccess;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace KhoaLuan.MainSys.Controls
{
    public partial class ctIntroOrg : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                var _org = Request.QueryString["OrgID"];
                int orgid = 1;
                if (_org != null)
                {
                    orgid = int.Parse(_org);
                }
                tbOrg_Proxy proxy = new tbOrg_Proxy();
                tbOrg conten = proxy.GetById_tbOrg_Proxy(orgid).ToObject<tbOrg>();
                tbIntroduce_Proxy proxyintro = new tbIntroduce_Proxy();
                tbIntroduce intro = proxyintro.GetIntroOrg(orgid);

                if (conten != null)
                {
                    lblOrgName.Text = conten.NameOrg;
                    lblSumUp.Text = HttpUtility.HtmlDecode(conten.Description);
                    imgOrg.Visible = false;
                    linkChiTiet.HRef = "~/MainSys/IntroduceDepPage.aspx?OrgID=" + orgid + "&IntroID=" + intro.IntroduceId;
                }
                else
                {
                    linkChiTiet.Visible = false;
                    lblSumUp.Visible = false;
                }
            }
        }
    }
}